package cn.spark.study.sql

import org.apache.spark.sql.SQLContext

object PurquetDataLoad {
  def main(args: Array[String]): Unit = {
    val sc = new ContextUtil()
        .getContext("PurquetDataLoad")
     
    val sqlC = new SQLContext(sc)
    sqlC.read.parquet("hdfs://spark1:9000/users.parquet").registerTempTable("users")
    sqlC.sql("select * from users" ).rdd.map { "name" + ":" + _.getString(0) }.collect().foreach { println }
  }
}